<?php
define('EmpireCMSAdmin','1');
require_once("../class/connect.php");
require_once("../class/db_sql.php");
require_once("../class/functions.php");
require_once("../class/say.php");
$link=db_connect();
$empire=new mysqlquery();
$s=new say();
$action=$_POST['action'];
switch($action){
	case "add_say"://添加状态
		$title=$_REQUEST["title"];
	$s->add(array("userid"=>"1","title"=>"$title","time"=>time()));
	$d=$s->getLastOne();
	$d["time"]=getFormatTime($d["time"]);
	$r=array("flag"=>1,"d"=>$d);
		echo json_encode($r);
	break;
	case "get_say":	//取得状态	
		$d=$s->getLastOne();
		$d["time"]=getFormatTime($d["time"]);
		$r=array("flag"=>1,"d"=>$d);
		echo json_encode($r);
	break;
}
?>